package com.sky.controller.admin;

import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.OrderService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.websocket.server.PathParam;
import java.util.List;

@RestController
@RequestMapping("/admin/order")
@Slf4j
@Api(tags = "admin-订单相关接口")
public class OrderController {

    @Autowired
    private OrderService orderService;


    // http://localhost/api/order/conditionSearch?page=1&pageSize=10
    @GetMapping("/conditionSearch")
    public Result<PageResult> conditionSearch(OrdersPageQueryDTO ordersPageQueryDTO) {
        log.info("这里是订单的查询接口");
        PageResult pageResult = orderService.queryOrder(ordersPageQueryDTO);
        return Result.success(pageResult);
    }

}
